<%@ page import="com.hahaduo.bee.web.form.AccountTypeForm"%>
<%@ page import="com.hahaduo.bee.dto.AccountTypeDto"%>
<%@ page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<script type="text/javascript">
<!--

function deleteConfirm(id) {
	if(confirm("Are you sure delete this?")) {
		window.location.href="delete/"+id;
	}
}
//-->
</script>
</head>
<body>

	Function :
	<a href="add">Add Customer</a>
	<hr />

	<h2>All Type</h2>
	<table border="1">
		<thead>
			<tr>
				<th>Name</th>
				<th>Label1</th>
				<th>Label2</th>
				<th>Action</th>
			</tr>
		</thead>
		<tbody>

			<c:forEach var="dto" items="${accountTypeForm.list}">

				<tr>
					<td>${dto.name}</td>
					<td>${dto.label1}</td>
					<td>${dto.label2}</td>
					<td><a href="update/${dto.id}">Update</a> | 
					
					<a href="#" onclick="deleteConfirm(${dto.id});">Delete</a></td>
					
				</tr>

				<c:forEach var="child" items="${dto.childen}">
					<tr>
						<td style="padding-left: 30px;">${child.name}</td>
						<td>${child.label1}</td>
						<td>${child.label2}</td>
						<td><a href="update/${child.id}">Update</a> | 
						
						<a href="#" onclick="deleteConfirm(${child.id});">Delete</a></td>
					</tr>
				</c:forEach>
			</c:forEach>

		</tbody>
	</table>

</body>
</html>